In general, when a numerical control (hereinafter, referred to as “NC”) device is used to control a machine tool to perform machining, an NC program (NC data for machining) that describes the movement of a tool of the machine tool is debugged. Specifically, a workpiece serving as an object to be machined is placed on a table of the machine tool in advance, and an operator runs and verifies the NC program in each step.
At this time, part of the machine tool, such as a tool or a ram, may come into contact with the workpiece and be broken due to human error, such as a defect of the NC program and an incorrect operation by the operator (for example, see PTL 1).
In particular, the operation speed is set high to improve the work efficiency when a tool that is not used to cut the workpiece is set in position, or in a similar case. When the NC program is debugged in such a state, if part of the machine tool is almost brought into contact with the workpiece, it is difficult for the operator to instantly stop the operation of a main shaft of the machine tool at his/her own judgment.
In order to prevent breakage of the machine tool due to contact with the workpiece, as described above, various technologies have been proposed.
For example, a sensor for detecting contact between the workpiece and the tool is known, and this sensor is used to determine whether the tool and the workpiece come into contact.
On the other hand, in order to avoid a collision between the workpiece and the tool etc., a control method in which the tool is stopped before colliding with the workpiece is also known. When this control method is used, it is necessary to recognize, in advance, the size, the dimensions, and the shape of the workpiece and 3D data (3D-CAD data) of the workpiece shape, such as the position of the workpiece on the table.
However, 3D data of the workpiece shape before machining is not known in advance in many cases, and it is necessary to obtain it by measuring the workpiece or by another method.
To obtain 3D data of the workpiece shape, a method of measuring the workpiece in a non-contact manner is known. For example, a digitizer that produces digital data of a 3D object is known (for example, see NPL 1).
A technology for measuring a fine surface shape, such as machining marks (milling marks), by using a noncontact displacement gauge is also known (for example, see PTLs 2 and 3). This displacement gauge is attached to the ram, instead of a tool, and scans the workpiece, thereby making it possible to detect the shape of the workpiece with high accuracy.
To express the thus-acquired 3D data, a 3D bit map technique is known (for example, see PTL 4).
Furthermore, a technology in which a workpiece detection device, as described above, is automatically exchanged, like a tool, is also known (for example, see PTL 5).